﻿<%@ Page Language="C#" MasterPageFile="~/design/Admin.Master" AutoEventWireup="true"
    CodeFile="Vstupenky.aspx.cs" Inherits="Zadani09.admin.Vstupenky" Title="Správa vstupenek" %>

<asp:Content ID="Content1" ContentPlaceHolderID="LoginPlaceholder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MenuPlaceholder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentVrchniPlaceholder" runat="server">
    <h2>
        Seznam vstupenek</h2>
    <asp:GridView ID="GridView1" runat="server" 
    BackColor="LightGoldenrodYellow" BorderColor="Tan"
        BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" Width="740px"
        AllowPaging="True" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
        DataKeyNames="IDUzivatel,IDVystava,Datum">
        <FooterStyle BackColor="Tan" />
        <Columns>
            <asp:BoundField DataField="IDUzivatel" HeaderText="ID Uživatele" 
                SortExpression="IDUzivatel" ReadOnly="True" />
            <asp:BoundField DataField="IDVystava" HeaderText="ID Výstavy" 
                SortExpression="IDVystava" ReadOnly="True" />
            <asp:BoundField DataField="Datum" HeaderText="Datum" SortExpression="Datum" 
                ReadOnly="True" />
            <asp:BoundField DataField="PocetDeti" HeaderText="Počet dětí" 
                SortExpression="PocetDeti" />
            <asp:BoundField DataField="PocetDospeli" HeaderText="Počet dospělých" 
                SortExpression="PocetDospeli" />
            <asp:TemplateField HeaderText="Stav" SortExpression="Stav">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" 
                        Text='<%# (Eval("Stav").ToString() == "0" ? "rezervována" : Eval("Stav").ToString() == "1" ? "prodána" : "doručena") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" Height="20px" 
                        SelectedValue='<%# Bind("Stav") %>' Width="150px">
                        <asp:ListItem Value="0">Rezervována</asp:ListItem>
                        <asp:ListItem Value="1">Zaplacena</asp:ListItem>
                        <asp:ListItem Value="2">Doručena</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:CommandField DeleteText="Smazat" EditText="Edituj" ShowDeleteButton="True" 
                ShowEditButton="True" UpdateText="Aktualizuj">
                <ItemStyle Font-Bold="True" />
            </asp:CommandField>
        </Columns>
        <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
        <HeaderStyle BackColor="Tan" Font-Bold="True" />
        <AlternatingRowStyle BackColor="PaleGoldenrod" />
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="Zadani09.db.Vstupenka"
        DeleteMethod="smaz" OldValuesParameterFormatString="original_{0}"
        SelectMethod="cti" TypeName="Zadani09.db.ODS.VstupenkaDataObject" 
    UpdateMethod="aktualizuj">
        <SelectParameters>
            <asp:Parameter Name="razeni" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentSpodniPlaceholder" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="BottomPlaceholder" runat="server">
</asp:Content>
